package com.example.dml.observer_pattern;

/**
 * @Authors：gaoyang
 * @CreateTime：2021-11-01
 * @Description：todo
 */
public class ObserverTest {

    public static void main(String[] args) {
        Gper gper = Gper.getInstance();
        Teacher tom = new Teacher("TOM");
        Teacher mic = new Teacher("MIC");
        gper.addObserver(tom);
        gper.addObserver(mic);
        Question question = new Question();
        question.setUsername("小米");
        question.setContent("观察者有哪些厂家呢？");
        gper.publishQuestion(gper,question);
    }
}
